﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace FB.Data.Models
{
    public interface IFBAuditModel
    {
        string ModifiedBy { get; set; }
        DateTime ModifiedDate { get; set; }
        string CreatedBy { get; set; }
        DateTime CreatedDate { get; set; }
    }

    public interface IFBModelCreaterLog
    {
        string CreatedBy { get; set; }
        DateTime CreatedDate { get; set; }
    }

    public abstract class FBModelCreaterLog : FBBaseModel, IFBModelCreaterLog
    {
        [StringLength(256)]
        [Display(ResourceType = typeof(Resources.Models.FBAuditModel), Name = "CreatedBy")]
        public string CreatedBy { get; set; }

        [Display(ResourceType = typeof(Resources.Models.FBAuditModel), Name = "CreatedDate")]
        public DateTime CreatedDate { get; set; }
    }

    public abstract class FBAuditModel : FBModelCreaterLog, IFBAuditModel
    {
        [StringLength(256)]
        [Display(ResourceType = typeof(Resources.Models.FBAuditModel), Name = "ModifiedBy")]
        public string ModifiedBy { get; set; }

        //[ConcurrencyCheck]
        [Display(ResourceType = typeof(Resources.Models.FBAuditModel), Name = "ModifiedDate")]
        public DateTime ModifiedDate { get; set; }

        public FBAuditModel() { }
        public FBAuditModel(FBAuditModel model) {
            this.ModifiedBy = model.ModifiedBy;
            this.ModifiedDate = model.ModifiedDate;
            this.CreatedBy = model.CreatedBy;
            this.CreatedDate = model.CreatedDate;
        }
    }

}